package com.smarthospital.web.controller;

import com.github.pagehelper.PageInfo;
import com.smarthospital.common.Result.ResultDTO;
import com.smarthospital.dao.im.daoService.IMMessageDaoService;
import com.smarthospital.entity.im.IMMessage;
import com.smarthospital.entity.pojo.Doctor;
import com.smarthospital.service.impl.LoginServiceIpml;
import com.smarthospital.service.impl.UserServiceImpl;
import com.wechat.pay.contrib.apache.httpclient.WechatPayHttpClientBuilder;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.utils.URIBuilder;
import org.apache.http.util.EntityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.io.IOException;
import java.net.URISyntaxException;

/**
 * create by sym  2020/8/16 16:00.
 */
@RestController
@Slf4j
@RequestMapping("/test")
@Api(description = "测试")
public class TestController {

    @Autowired
    IMMessageDaoService imMessageDaoService;

    @Autowired
    private UserServiceImpl userService;


    @GetMapping("/ts1")
    public ResultDTO ts1(@RequestParam("sessionId") String sessionId){
        Page<IMMessage> bySessionId = imMessageDaoService.getByOrderId(sessionId);
        return ResultDTO.sucess(bySessionId);
    }

    @GetMapping("/ts2")
    public ResultDTO ts2(){
        userService.initUser("AAA");
        return ResultDTO.sucess();
    }

    @GetMapping("/ts3")
    public ResultDTO ts3(){
        return ResultDTO.sucess();
    }


}
